version: '2.1'

services:
  localstack:
    container_name: "{{ localstack.container }}"
    image: localstack/localstack
    ports:
      - "4567-4599:4567-4599"
      - "{{ localstack.web_ui }}-{{ localstack.web_ui }}:{{ localstack.web_ui }}-{{ localstack.web_ui }}"
    environment:
      - SERVICES=s3
      - DEBUG={{ localstack.debug }}
      - DATA_DIR={{ localstack.data_dir }}
      - PORT_WEB_UI={{ localstack.web_ui }}
      - LOCALSTACK_HOSTNAME={{ localstack.hostname_external }}
      - LAMBDA_EXECUTOR=local
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - "/tmp/localstack:/tmp/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"
